package com.ssh;

public class ArrangeCoins_441 {
	public int arrangeCoins(int n) {
        int t = 1;
        while (n > 0) {
        	n -= t;
        	t++;
        }
        return n == 0 ? t-1 : t-2;
    }
}
